
#include<cstdio>
#include<cstring>
#include<stack>
#include<queue>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
const double EPS=1e-6;
const int maxn=110;
double x1[maxn],Y1[maxn],x2[maxn],y2[maxn],X[maxn*2],Y[2*maxn];
bool v[maxn*2][maxn*2];

int Bsearch(double k,double num[],int n) 
{ 
   int mid,l=1,r=n; 
   while(l<=r) 
   { 
       mid=(r+l)/2;
	   if(abs(k-num[mid])<=EPS)return mid; 
       if(k<num[mid]) r=mid-1; //less than it. 
       else if(k>num[mid]) l=mid+1; //bigger than it. 
   } 
   return -1; //fail to find. 
}
bool cmp(double x,double y)
{
	return x<y;
}

int main()
{
	freopen("test.in","r",stdin);
	int n,count=0;
	while(scanf("%d",&n),n!=0)
	{
		count++;
		for(int i=1;i<=n;i++)
		{
			scanf("%lf%lf%lf%lf",&x1[i],&Y1[i],&x2[i],&y2[i]);
			X[2*i-1]=x1[i];
			X[2*i]=x2[i];
			Y[2*i-1]=Y1[i];
			Y[2*i]=y2[i];
		}
		sort(X+1,X+2*n+1,cmp);
		sort(Y+1,Y+2*n+1,cmp);
		int m1=0,m2=0;
		for(int i=1;i<=2*n;i++)
			if(X[i]!=X[i+1])X[++m1]=X[i];
		for(int i=1;i<=2*n;i++)
			if(Y[i]!=Y[i+1])Y[++m2]=Y[i];
		memset(v,0,sizeof(v));
		double ans=0;
		for(int i=1;i<=n;i++)
		{
			int i1=Bsearch(x1[i],X,m1);
			int i2=Bsearch(x2[i],X,m1);
			int j1=Bsearch(Y1[i],Y,m2);
			int j2=Bsearch(y2[i],Y,m2);
			for(int s=i1;s<i2;s++)
				for(int t=j1;t<j2;t++)
				{
					if(!v[s][t])
						ans+=(X[s+1]-X[s])*(Y[t+1]-Y[t]);
					v[s][t]=true;
				}
		}
		printf("Test case #%d\nTotal explored area: %0.2lf\n\n",count,ans);	

	}
	return 0;
}


